package vip.finance.makemoney.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import vip.finance.makemoney.entity.Stock;
import vip.finance.makemoney.mapper.StockMapper;
import vip.finance.makemoney.mapper.UserStockMapper;
import vip.finance.makemoney.service.IStockService;

/**
 * <p>
 * 股票 服务实现类
 * </p>
 *
 * @author yangbin
 * @since 2023-02-09
 */
@Service
public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements IStockService {

    @Resource
    private UserStockMapper userStockMapper;
    @Resource
    private RedisService redisService;


    @Override
    public IPage<Stock> stockPageList(Integer current, Integer size, String market) {
        return baseMapper.selectPage(new Page<>(current, size), Wrappers.<Stock>lambdaQuery().eq(Stock::getMarket, market));
    }
}
